!% -SD !=============================================================================== Constant Story "Bus station v2"; Constant Headline "^A slightly less simple story fragment ^by Alex Mitchell.^"; Include "Parser"; Include "VerbLib"; !=============================================================================== ! The game objects ! the waiting room. player starts here Object waiting_room "Waiting room" with description "You are standing in a dingy, rundown waiting room in a bus terminal. The main entrance is to the north. To the south are the bus stands. To the west you can see a row of lockers. East leads to the men's toilet. One of the few remaining payphones on the planet clings desperately to the wall beside the toilet door. In the middle of the room is a single, cold, bare metal bench.", e_to toilet, s_to stands, w_to lockers, n_to "It's pouring down with rain outside. You'd better stay here.", before [; Go: if(payphone.ringing==true) { print_ret "You need to hangup the phone first"; } else { if(noun == s_obj) { if(stands.bus_is_waiting==true) { return false; } else { print_ret "The bus isn't here yet. Better wait in the waiting room until it arrives."; } } else { return false; } } ], has light; ! bench Object bench "bench" waiting_room with description "A cold metal bench, at least its somewhere to rest.", name 'cold' 'metal' 'seat' 'chair' 'bench', has static scenery enterable supporter; ! newspaper Object newspaper "newspaper" bench with description "A crumpled copy of today's paper. Looks like its been used to soak up some sticky liquid.", name 'paper' 'newspaper' 'news' 'scrap' 'rag', before [ w1 w2; Consult: wn = consult_from; w1 = NextWord(); ! First word of subject w2 = NextWord(); ! Second word (if any) of subject if (consult_words==1 && w1=='storm' or 'weather') { print_ret "The top story is, of course, about the ice storm. The worst since 1997, the entire eastern seaboard has been locked in ice since Sunday. Airports and trains are at a standstill, and the ice has brought down powerlines and phone lines across the country."; } else if (consult_words==1 && w1=='family' or 'parents') { print_ret "Nothing about your family. Perhaps tomorrow's paper will mention something? Surely someone must have found them by now."; } else { print_ret "You can't see anything about that in the paper. Maybe try a different topic?"; } ], has ; ! use the phone Verb 'phone' 'call' 'dial' * noun -> Call; [ CallSub; if(player in bench) { print "You can't reach the phone from here."; return false; } else { if(coin in payphone) { if(noun==home) { payphone.ringing=true; startDaemon(payphone); print_ret "Its ringing. You sure you want to do this?"; } else { print_ret "You don't know the number."; } } else { print "You need to put a coin in the phone first."; return false; } } ]; ! hang up the phone Verb 'hangup' 'putdown' * -> HangUp; [ HangUpSub; if(payphone.ringing==true) { payphone.ringing=false; stopDaemon(payphone); remove coin; print_ret "You hangup the phone in despair."; } else { print_ret "You can't hangup if you're not calling anyone!"; } ]; ! phone home Object payphone "payphone" waiting_room with description "A lone payphone, looking its age, clings to the wall beside the door to the men's toilet. Surprisingly, it looks like it still works.", name 'phone' 'payphone' 'antique' 'telephone', ringing false, rings 0, daemon [; self.rings ++; if(self.rings>4) { deadflag=2; print_ret "There's a click, and someone answers.^'Alex, is that you?'^You can't believe its actually your mom answering! An almost physical wave of relief sweeps over you, and you suddenly feel... what? Its almost impossible to describe. The nagging feeling in the pit of your stomach, the dryness in your throat, the deadness behind your eyes, suddenly, they're all gone.^'Where are you? We missed our flight, and couldn't get through because of the storm. Is everything ok?'^Yes, you think, after all, everything IS going to be ok."; } else { print_ret "The phone on the other end is still ringing."; } ], has scenery static container open; ! concealed magic object to allow phoning home Object home "home" waiting_room with description "There's no place like home.", name 'home' 'family' 'parents' 'mom', has static scenery; ! the bus stand Object stands "Bus stands" with description "A row of bus stands.", ! directions n_to waiting_room, cant_go "You have second thoughts about wandering into the bus bays in the dark.", ! values for when bus arrives time_until_bus 15, ! time from start of game time_arrive_announcement 5, ! time from start of game time_bus_waits 10, ! time from arrival time_leave_announcement 5, ! time from arrival bus_is_waiting false, ! is the bus at the stand now? bus_timer 0, ! time since start of game ! handle the bus arriving daemon [; stands.bus_timer++; if (stands.bus_is_waiting==true) { if(stands.bus_timer==stands.time_leave_announcement) { ! departure announcement print "The PA system crackles to life, and a distorted voice declares: ~The last bus to Montreal will be departing from Stand 2 in ", (stands.time_bus_waits - stands.time_leave_announcement), " minutes' time.~"; } else if(stands.bus_timer> stands.time_bus_waits) { ! bus leaves stands.bus_timer=0; stands.bus_is_waiting=false; print "With a shudder and a dull rumble, the bus pulls out into the night."; if(player in bus) { print "^As the bus pulls away, you wonder if you'll ever see your family again."; deadflag=3; } else { print "^You've missed the last bus. All you can do now is wait and hope for the best."; deadflag=3; } } } else { if(stands.bus_timer==stands.time_arrive_announcement) { ! arrival announcement print "The PA system crackles to life, and a distorted voice declares: ~The last bus to Montreal will be arriving at Stand 2 in ", (stands.time_until_bus - stands.time_arrive_announcement), " minutes' time.~"; } else if(stands.bus_timer> stands.time_until_bus) { ! bus arrives stands.bus_timer=0; stands.bus_is_waiting=true; move bus to stands; print "You hear a muffled roar as the bus pulls into the stands."; } } ! print_ret stands.bus_timer; ], has light; ! the bus Object bus "bus" with description "A Greyhound bus, bound for Montreal. Looks like it will be leaving soon.", name 'bus' 'coach' 'greyhound', before [; Enter: if(ticket in player) { return false; } else { print_ret "You need a ticket to get on the bus!"; } ], has enterable static; ! the men's toilet Object toilet "Men's toilet" with description "The men's toilet smells like a men's toilet. A row of urinals occupies one wall. Along the opposite wall are several cubicles, all locked except one, which is missing its door.", w_to waiting_room, has light; ! the row of locked cubicles Object cubicles "cubicles" toilet with description "The cubicles look, and smell, like they haven't been washed for years.", name 'cubicles' 'stalls' 'locked', has static scenery; ! the doorless cubicle Object cubicle "cubicle" toilet with description "One cubicle's door has been ripped from its hinges. You see a glint of something metalic on the floor.", name 'broken' 'missing' 'cubicle' 'stall' 'doorless', before [; Examine: if(coin in cubicle) { move coin to toilet; } ], has static scenery container; ! 25 cents Object coin "coin" cubicle with description "An old 25 cent piece.", name 'glint' 'metalic' 'coin' 'quarter' '25 cent piece', has; ! the row of urinals Object urinals "urinals" toilet with description "The urinals have seen better days.", name 'urinals' 'urinal', has static scenery; ! the row of lockers Object lockers "Lockers" with description "This small alcove contains a row of storage lockers.", e_to waiting_room, has light; ! this locker can be opened with the key Object locker "locker" lockers with description "A standard locker.", name 'locker' 'lockers', with_key key has static scenery container openable lockable locked; ! inside the locker... Object diary "diary" locker with description "A small diary. The handwriting looks very familiar. You suddenly feel a wave of nausea, and look away.", tries 0, before [; Take: if(self.tries<1) { self.tries++; print_ret "As you start to pick up the diary, you are overcome with a strong sense of foreboding. You quickly put the diary back in the locker."; } else { print "Taking a deep breath, you grasp the diary and pick it up. There seems to be something between the pages.^"; return false; } Open: if(diary in player) { if(ticket in diary) { print "Something slips out from between the pages of the diary into the locker.^"; move ticket to locker; } return false; } else print_ret "You'll have to take the diary first."; ], name 'diary' 'book' 'journal', has container openable; ! inventory objects ! bus ticket Object ticket "ticket" diary with description "A one-way ticket for the 00:15 bus to Montreal.", name 'ticket' 'bus ticket', before [; insert: if(second==payphone) { print_ret "It doesn't seem to fit."; } ], has ; ! key to the locker Object key "key" with description "A small key, looks like it might fit into a storage locker.", name 'key', before [; insert: if(second==payphone) { print_ret "You try your best to jam the key in the phone, but to no avail."; } ], has ; ! ipod Object ipod "ipod" with description "Second gen ipod. Still works, amazingly.", name "ipod", before [; insert: if(second==payphone) { print_ret "I don't think so."; } ], has switchable; !=============================================================================== ! Entry point routines [ Initialise; location = bench; move key to player; move ipod to player; player.description = "You are wearing a grey hoodie, jeans and converse all-stars, hands stuffed defiantly into your jean pockets."; StartDaemon(stands); print_ret "^^ Its been two days now. You can't believe that it really happened. They were supposed to get back on Sunday night, but every since the storm, there's been no word. Finally, you decide that there's only one thing you can do..."; ]; [ DeathMessage; print "The End"; ]; !=============================================================================== ! Standard and extended grammar Include "Grammar"; !===============================================================================